package com.jh.user.pojo.enums;

import cn.jh.common.tools.Strings;

/**
 * 交易类型枚举
 *
 * @author Yichuan
 * @version 1.0
 */
public enum ThirdPayType {

    ALIPAY("ALIPAY", "支付宝"),

    WECHAT("WECHAT", "微信"),

    ;

    final String value;
    final String desc;

    ThirdPayType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static ThirdPayType of(String value) {
        if (Strings.isNullOrEmpty(value)) {
            return null;
        }
        if (value.equalsIgnoreCase("ALIPAY")) {
            return ALIPAY;
        } else if (value.equalsIgnoreCase("WECHAT")) {
            return WECHAT;
        } else {
            return null;
        }
    }
}
